package com.ss.android.article.base.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;

import java.util.HashSet;
import java.util.Iterator;

public class DuplicatePressedRelativeLayout extends RelativeLayout {
    private HashSet<View> views = new HashSet();

    public DuplicatePressedRelativeLayout(Context arg2) {
        super(arg2);
    }

    public DuplicatePressedRelativeLayout(Context arg2, AttributeSet arg3) {
        super(arg2, arg3);
    }

    public DuplicatePressedRelativeLayout(Context arg2, AttributeSet arg3, int arg4) {
        super(arg2, arg3, arg4);
    }

    public final void addAffectView(View view) {
        this.views.add(view);
    }

    protected void dispatchSetPressed(boolean pressed) {
        super.dispatchSetPressed(pressed);
        Iterator<View> iterator = this.views.iterator();
        while (iterator.hasNext()) {
            View view = iterator.next();
            if (view == null) {
                continue;
            }
            view.setPressed(pressed);
        }
    }
}

